package com.iamteer.service.impl;

import java.util.List;

import com.iamteer.dao.IDishDao;
import com.iamteer.entity.Dish;
import com.iamteer.factory.BeanFactory;
import com.iamteer.service.IDishService;
/**
 * 3. 菜品 Service 实现
 * @author Chuck
 *
 */
public class DishService implements IDishService {

	private IDishDao dishDao = BeanFactory.getInstance("dishDao", IDishDao.class);
	
	@Override
	public void add(Dish dish) {
		dishDao.add(dish);
	}

	@Override
	public void delete(int id) {
		dishDao.delete(id);
	}

	@Override
	public void update(Dish dish) {
		dishDao.update(dish);
	}

	@Override
	public List<Dish> query() {
		return dishDao.query();
	}

	@Override
	public List<Dish> query(int category_id) {
		return dishDao.query(category_id);
	}

	@Override
	public List<Dish> query(String keyword) {
		return dishDao.query(keyword);
	}

	@Override
	public Dish findById(int id) {
		return dishDao.findById(id);
	}

}
